package com.suixinsanren.design.proxy.demo.demo03;

public class DuckProxy implements Duck {

    private final Duck duck;
    private int quackCounter = 0;
    private int flyCounter = 0;

    public DuckProxy(Duck duck) {
        this.duck = duck;
    }

    @Override
    public void quack() {
        duck.quack();
        quackCounter++;
    }

    @Override
    public void fly() {
        duck.fly();
        flyCounter++;
    }

    public int getQuackCounter() {
        return quackCounter;
    }

    public int getFlyCounter() {
        return flyCounter;
    }
}
